<?php
class tagsApi extends baseApi{

    public function get_menu_expand(){
        return array(
            0 => array('name'=>'TAG管理','url'=>url('admin_list/index'),'sequence'=>4),
            );
    }

    //TAG信息
    public function tag_info($name)
    {
        return model('tags')->info($name);
    }

	//关联TAG内容
	public function content_save($data)
    {
    	return model('tags')->content_save($data['keywords'],$data['aid']);
    }

    //删除TAG内容
    public function content_del($aid)
    {
    	return model('tags')->del_content($aid);
    }

    //通过内容查找关联
    public function relation_aid($aid){
        return model('tags_relation')->relation_aid($aid);
    }

    //通过TAGID查找
    public function relation_tid($tid){
        return model('tags_relation')->relation_tid($tid);
    }

    //TAG标签列表
	public function hook_label_list(){
		return array(
			'tags'=>array(
				'app'=>'tags',
				'action'=>'label_tags_list',
			)
		);
	}
	
    public function label_tags_list($data){
        return model('tags_label')->tags_list($data['data']);
    }

    //获取TAG总数
    public function tags_count(){
        return model('tags')->count();
    }
	
}